package com.neusoft.elmboot.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import com.neusoft.elmboot.po.Business;
import com.neusoft.elmboot.po.User;

@Mapper
public interface BusinessMapper {

    @Select("select * from business where orderTypeId=#{orderTypeId} order by businessId")
    public List<Business> listBusinessByOrderTypeId(Integer orderTypeId);

    @Select("select * from business where businessName like concat('%',#{businessName},'%') order by businessId")
    public List<Business> listBusinessByKeyWords(String businessName);

    @Select("select * from business where businessId=#{businessId}")
    public Business getBusinessById(Integer businessId);
    
    @Insert("insert into business (businessName, businessImg, orderTypeId) value (#{businessName}, #{businessImg}, 1)")
    public int saveBusiness(Business business);
    
}
 